package com.clarte.common.action;

import java.util.ArrayList;
import java.util.List;

public class PagerList extends ArrayList {
	private int pageNo = 1;//页码
	private int rows = 10;//每页行数
	private int total;//总页数
	private int records;//总记录数
	
	public int getPageNo() {
		return pageNo;
	}
	public void setPageNo(int pageNo) {
		this.pageNo = pageNo;
	}
	public int getRows() {
		return rows;
	}
	public void setRows(int rows) {
		this.rows = rows;
	}
	public int getTotal() {
		return total;
	}
	public void setTotal(int total) {
		this.total = total;
	}
	public int getRecords() {
		return records;
	}
	public void setRecords(int records) {
		this.records = records;
		this.total = (int)Math.ceil((double) this.records / (double) this.rows);
	}
	public static List getResult(List list,int records){
		PagerList pagerlist = new PagerList();
		pagerlist.addAll(list);
		pagerlist.setRecords(records);
		return pagerlist;
	}
}
